package com.yhy.wxzn.common.enums;


public enum PlcAddressTypeEnums {

    PORT_READ(1, "出入库口读"),
    PORT_WRITE(2, "出入库口写"),
    TRANSMISSION_READ(3, "输送线读"),
    TRANSMISSION_WRITE(4, "输送线写"),
    HOIST_READ(5, "提升机读"),
    HOIST_WRITE(6, "提升机写"),
    STACKER_READ(7, "拆叠盘机读"),
    CAR_PICK_WRITE(8, "小车取货写"),
    CAR_PUT_WRITE(9, "小车放货写"),
    CAR_PICK_HOIST_WRITE(10, "小车提升机取货写"),
    CAR_PUT_HOIST_WRITE(11, "小车提升机放货写"),
    CAR_IN_WRITE(12, "小车进提升机写"),
    CAR_OUT_WRITE(13, "小车出提升机写"),
    BCR_READ(14, "容器读"),
    WEIGH_READ(15, "称重读"),
    DETECTION_READ(16, "外形检测读"),
    ALLOT_WRITE(17, "分拨口写"),
    DEMOLISH_READ(18, "拆盘机读"),
    PILEUP_READ(19, "叠盘机读"),
    BUTTON_READ(20, "按钮读"),
    FOURCAR_READ(21, "四向车读"),
    FOURCAR_WRITE(22, "四向车写"),
    FOURCAR_JB(23, "四向车接驳点"),

    HEARTBEAT_READ(98,"心跳读"),
    HEARTBEAT_WRITE(99,"心跳写");

    private final int value;
    private final String desc;

    PlcAddressTypeEnums(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static PlcAddressTypeEnums ofValue(Integer target) {
        for (PlcAddressTypeEnums status : values()) {
            if (status.value == target) {
                return status;
            }
        }
        return null;
    }
}
